#include <stdio.h>
int m = 12;
int function1 (int a, int b, int c, int d);

void main (void)
{
    int n = 30;
    int e, f, g, h, i;
    e = 1;
    f = 2;
    g = 3;
    h = 4;
    printf ("\n\n In main (before the call to function1):\n\
            \r m = %d\n\
            \r n = %d\n\
            \r e = %d\n\n", m, n, e);
    i = function1 (e, f, g, h);
    printf ("After returning to main:\n");
    printf ("n = %d \n\
            \r m = %d \n\
            \r e = %d \n\
            \r i = %d", n, m, e, i);
}


int function1 (int a, int b, int c, int d)
{
    int n = 400;

    printf ("In function1:\n\
            \r n = %d\n\
            \r m = %d initially\n\
            \r a = %d initially \n",n,m,a);
    m = 999;
    if (a>=1)
    {
        a += b + m + n;
        printf ("m = %d after being modified\n\
                \r a = %d after being modified\n\n", m, a);
        return (a);
    }
    else
    {
        c += d + m + n;
        return (c);
    }
}

